 #pragma once
#include <d3dx9.h>
#include <vector>
#include "BBox.h"

class cModel
{
public:
	struct MTRL {
		D3DMATERIAL9		mtrl;
		LPDIRECT3DTEXTURE9	tex;

		MTRL();
	};

	int life;

public:
	ID3DXMesh*			mMesh;
	std::vector<MTRL>	mMtrl;
	BBox							mBbox;
	BSphere					mBsphere;

public:
	cModel(void);
	~cModel(void);

	BBox getBoundingBox()		{ return mBbox;		}
	BSphere getBoundingSphere() { return mBsphere;	}

	void load(const char* fileName);
	void release();
	void render();

private:
	BBox calcBoundingBox();
	BSphere calcBoundingSphere();
};
